<template>
  <div>
    <el-menu-item :index="navItem.url" v-if="!navItem.child">
      <i class="el-icon-menu"></i>
      <span>{{ navItem.name }}</span>
    </el-menu-item>

    <el-submenu :index="navItem.url" v-else>
      <template slot="title">
        <i class="el-icon-location"></i>
        <span>{{ navItem.name }}</span>
      </template>
      <NavChild v-for="item in navItem.child" :key="item.url" :navItem="item" />
    </el-submenu>
  </div>
</template>
<script>
export default {
  name: "NavChild",
  props: ['navItem'],
};
</script>
